<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateImagesTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('images', function (Blueprint $table) {
            $table->unsignedSmallInteger('id');
            $table->boolean('place')->default(0)->comment('1:启动图片 2:首页banner图');
			$table->string('title', 32)->default('')->comment('名称');
			$table->unsignedMediumInteger('article_id')->default(0)->comment('文章ID');
			$table->unsignedSmallInteger('rank')->default(0)->comment('排序');
			$table->string('img', 32)->default(0)->comment('图片七牛Key');
            $table->timestamps();
            $table->softDeletes();
            $table->primary('id');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('images');
    }
}
